package com.example.zq.player.linked_database_interface;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Toast;

import com.example.zq.player.R;

public class MyInformationActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.my_information);

        EditText et_my_information_edit_name = findViewById(R.id.et_my_information_edit_name);
        EditText et_my_information_edit_email = findViewById(R.id.et_my_information_edit_email);
        EditText et_my_information_edit_phone = findViewById(R.id.et_my_information_edit_phone);

        et_my_information_edit_name.setText(GlobalInformation.getUser().getUsername());
        et_my_information_edit_email.setText(GlobalInformation.getUser().getEmail());
        et_my_information_edit_phone.setText(GlobalInformation.getUser().getPhone());

        et_my_information_edit_name.setEnabled(false);
        et_my_information_edit_email.setEnabled(false);
        et_my_information_edit_phone.setEnabled(false);

        RadioButton rb_my_information_male = findViewById(R.id.rb_my_information_male);
        RadioButton rb_my_information_famale = findViewById(R.id.rb_my_information_famale);
        rb_my_information_male.setEnabled(false);
        rb_my_information_famale.setEnabled(false);

        Button bt_my_information_commit_change = findViewById(R.id.bt_my_information_commit_change);
        bt_my_information_commit_change.setText("修改信息");
        bt_my_information_commit_change.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                EditText et_my_information_edit_name = findViewById(R.id.et_my_information_edit_name);
//                EditText et_my_information_edit_email = findViewById(R.id.et_my_information_edit_email);
//                EditText et_my_information_edit_phone = findViewById(R.id.et_my_information_edit_phone);
                Toast.makeText(MyInformationActivity.this, "正在开发，敬请期待！", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
